package com.handydata.antifraud.common.constant;

import java.util.HashMap;
import java.util.Map;

/**
 * 告警信息表异常码枚举类
 * 
 * @author baiyx
 * @email baiyunxing@handy-data.cn
 * @date 2019-08-27 20:57:31
 */
public enum AlarmInfoCode {


	REDIS_ALARM_RULE_ALL("AR","redis key规则信息前缀"),
	REDIS_ALARM_RULE_TIMEOUT("ARO","redis key 规则超时前缀"),
	REDIS_ALARM_WACTH("AW","reis 报警监控前缀"),
	REDIS_GENERAL_DICT("GD","reis 通用字典前缀"),

	REDIS_DEALED_KEY("DK","已经处理的超时key"),

	REDIS_BANK_COUNT_KEY("BC","上行统计"),

	ALARM_TYPE_ERR("2","错误报警"),
	ALARM_TYPE_TIMEOUT("1","超时报警"),


	ALERT_ITEM_ORDER("1","订单处理"),
	ALERT_ITEM_RULE("2","规则处理"),
	ALERT_ITEM_WS("3","外部接口"),
	SEND_MODEL_PHONE("1","手机"),
	SEND_MODEL_EMAIL("2","邮件"),
	SEND_MODEL_ALL("3","全部"),
	SEND_STATUS_SUCESS("1","成功"),
	SEND_STAUS_FAIL("2","失败");

	public String code;
    public String name;



    private AlarmInfoCode(String code, String name){
        this.code = code;
        this.name = name;
    }

	public String getCode() {
		return this.code;
	}

	public String getName() {
		return this.name;
	}


	public static Map<String,String> alertTypeMap;
	public static Map<String,String> sendModelMap;
	public static Map<String,String> alertItemMap;

	static {
		alertTypeMap=new HashMap<>();
		sendModelMap=new HashMap<>();
		alertItemMap=new HashMap<>();
		alertTypeMap.put(ALARM_TYPE_ERR.getCode(),ALARM_TYPE_ERR.getName());
		alertTypeMap.put(ALARM_TYPE_TIMEOUT.getCode(),ALARM_TYPE_TIMEOUT.getName());
		alertItemMap.put(ALERT_ITEM_ORDER.getCode(),ALERT_ITEM_ORDER.getName());
		alertItemMap.put(ALERT_ITEM_RULE.getCode(),ALERT_ITEM_RULE.getName());
		alertItemMap.put(ALERT_ITEM_WS.getCode(),ALERT_ITEM_WS.getName());
		sendModelMap.put(SEND_MODEL_PHONE.getCode(),SEND_MODEL_PHONE.getName());
		sendModelMap.put(SEND_MODEL_EMAIL.getCode(),SEND_MODEL_EMAIL.getName());
		sendModelMap.put(SEND_MODEL_ALL.getCode(),SEND_MODEL_ALL.getName());
	}

}
